package oj;

import stack_quene.stack.stack.Stack;



 class MinStack {
     private Stack<Integer> real = new Stack<>();
     private Stack<Integer> support = new Stack<>();

     public MinStack() {

     }


     public void push(int val) {
         real.push(val);
         if (support.isEmpty()) {
             support.push(val);
         }else{
             int tmpValue=support.peek();
             int min=  Math.min(val,tmpValue);
             support.push(min);
         }

     }
         public void pop () {
             real.pop();
             support.pop();

         }

         public int top () {
             return real.peek();

         }

         public int getMin () {
             return support.peek();

         }

     }
